<!-- 首页新闻公告 -->
<style lang="scss">
.pro-crm-home-announce {
  background: #ffffff;
  position: relative;
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.06);
  overflow: hidden;
  width: 960px;
  .news-edit {
    position: absolute;
    top: 12px;
    right: 30px;
    cursor: pointer;
    color: #cccccc;
    &:hover {
      color: #2f6bcf;
    }
  }
  .el-tabs__header {
    margin: 0;
  }
  .announcement-list {
    padding-bottom: 0;
    .je-vue-listview {
      padding: 0;
    }
  }
  .bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: #f4f7fd;
  }
  .title {
    height: 44px;
    line-height: 16px;
    overflow: hidden;
    padding: 13px 20px 13px 16px;
    border-bottom: 1px solid #e4e4f0;
    .left {
      float: left;
      font-family: MicrosoftYaHei-Bold;
      font-weight: 600;
      font-size: 16px;
      color: #282f50;
      span,
      img {
        vertical-align: middle;
      }
      span {
        padding-left: 8px;
      }
    }
    .right {
      float: right;
      font-size: 14px;
      cursor: pointer;
      i {
        vertical-align: middle;
      }
    }
  }

  .listview-body {
    height: 160px !important;
  }
}
/* 下拉样式 */
.pro-crm-home-announce.arrow_down {
  position: absolute;
  top: 0;
  right: 50px;
  z-index: 3;
  height: auto;
  .listview-body {
    height: 936px !important;
  }
}
</style>
<template>
  <div :class="{ 'pro-crm-home-announce': true, arrow_down: !arrowDown }">
    <div class="title">
      <div class="left">
        <img src="../../assets/images/je-announcement.png" alt="" />
        <span> {{ lang == "zh_CN" ? "新闻公告" : "News Announcement" }} </span>
      </div>
      <div class="right">
        <i v-show="arrowDown" class="el-icon-arrow-down" @click="arrowEdit"></i>
        <i v-show="!arrowDown" class="el-icon-arrow-up" @click="arrowEdit"></i>
      </div>
    </div>
    <!-- 01 新闻公告的编码 -->
    <news-list :ref="'list-' + '01'" :type="'01'" autoload></news-list>
  </div>
</template>
<script>
import NewsList from "./announcement_list.vue";

export default {
  name: "home-news",
  components: { NewsList },
  data() {
    return {
      arrowDown: true,
      lang: JE.getCookies("je-local-lang") || "zh_CN",
    };
  },
  computed: {
    activeTab() {
      //初始化项
      return this.items[0].code;
    },
    items() {
      //根据新闻类型字典获得子项
      return JE.getDicItems("JE_SYS_NOTICETYPE");
    },
  },
  methods: {
    /* 下拉展开 */
    arrowEdit() {
      this.arrowDown = !this.arrowDown;
      console.log(this.items);
    },
  },
};
</script>


